package io.gitee.bowen_lee.rpc;

import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * 连接池
 * 
 * @author Bowen
 * @since 2022-01-18 15:14:43
 */
public class BowenClientPool {
  NioSocketChannel[] clients;
  Object[] lock;

  public BowenClientPool(int size) {

    clients = new NioSocketChannel[size];
    lock = new Object[size];
    for (int i = 0; i < size; i++) {
      lock[i] = new Object();
    }
  }

  NioSocketChannel getClient(int index) {
    try {
      return clients[index];
    } catch (Exception e) {
      return null;
    }
  }

}
